package com.evil.mi.controller;

import com.evil.mi.service.CrawlerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * com.evil.mi.controller
 *
 * @author 白雨浓
 * date: 2018/8/25 13:37
 * content:
 */
@RestController
@RequestMapping("/crawler")
public class CrawlerController {

    @Autowired
    private CrawlerService crawlerService;

    @PostMapping("/start")
    public void start() {
        crawlerService.start();
    }

    @PostMapping("/stop")
    public void stop() {
        crawlerService.stop();
    }
}
